/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.uniminuto.park.controlador;


import co.uniminuto.park.clases.Usuario;

import co.uniminuto.park.dao.loginDao;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.bson.types.ObjectId;
import org.primefaces.context.RequestContext;
import org.primefaces.event.RowEditEvent;
import org.primefaces.model.map.DefaultMapModel;
import org.primefaces.model.map.LatLng;
import org.primefaces.model.map.MapModel;
import org.primefaces.model.map.Marker;

/**
 *
 * @author Esteban Rozo
 */
@ManagedBean
@ViewScoped
public class perfil {

    private Usuario user;
    FacesContext con = FacesContext.getCurrentInstance();
    private String log;
    HttpServletRequest req = (HttpServletRequest) con.getExternalContext().getRequest();
    HttpSession sesion = req.getSession(false);

    public String getLog() {
        return log;
    }

    public void setLog(String log) {
        this.log = log;
    }

    public Usuario getUser() {
        return user;
    }

    public void setUser(Usuario user) {
        this.user = user;
    }

    private EstacionamientosLista getElementoApplication() {
        FacesContext cont = FacesContext.getCurrentInstance();
        return cont.getApplication().evaluateExpressionGet(cont, "#{elementoApplication}", EstacionamientosLista.class);
    }

    public perfil(){
    
    user = new Usuario();
    user=infoPerfil();
    
    }
   

    public Usuario infoPerfil() {
        Usuario uSe = (Usuario) sesion.getAttribute("user");
        return uSe;

    }

   
    
}
